package cn.initcap.designpattern.pattern.creational.builder;

import com.google.common.collect.ImmutableSet;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;

/**
 * @author initcap
 * @date 2018/8/28 AM9:04
 */
public class Test {
    public static void main(String[] args) {
        Computer computer = new Computer.ComputerBuilder().buildCpu("酷睿I7").buildMainBoard("华硕主板").build();
        System.out.println(computer);

        ComputerLombok computerLombok = ComputerLombok.builder().cpu("酷睿I5").mainBoard("IMD").build();
        System.out.println(computerLombok);

        Set<String> set = ImmutableSet.<String>builder().add("a").add("b").build();
        System.out.println(set);

        List<String> tableList = new ArrayList<String>();
        tableList.add("table");
        List<Integer> seriesList = new ArrayList<Integer>();
        seriesList.add(1);
        JsonResult<String, Integer> jsonResult = JsonResult.<String, Integer>builder().tableDate(tableList).series(seriesList).type(1).build();
        System.out.println(jsonResult);

    }
}
